UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qPXeR0oDBibcpmbVfgcGQQpRcYeXDQmwpxZPXRv6pl8='
WHERE
key_id = 'e26204a543f730287649abe4dd212a2febac9ba42b6d7f15378ee303460e5665'
AND (
token = 'qPXeR0oDBibcpmbVfgcGQQpRcYeXDQmwpxZPXRv6pl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)