UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UkZcOxsJzWcKe+JhBxTqnZikl44SfPjfdlX6xXBmluM='
WHERE
key_id = '6b7f54b80bd1acd2d8a9452a9947e0c00b5dee260fd978f7ed42a88897654326'
AND (
token = 'UkZcOxsJzWcKe+JhBxTqnZikl44SfPjfdlX6xXBmluM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)