UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'orTo74Fnuo0t/adStpwgUTYA+rUBxv1z0lrsw30rGgs='
WHERE
key_id = 'c5383fad53c16f71180971a427144add605c344a7d2eb05ffb2866d0c9c6454b'
AND (
token = 'orTo74Fnuo0t/adStpwgUTYA+rUBxv1z0lrsw30rGgs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)