UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dvks1Duao7/PTGT2QaeoE0rbumoJtqVtS9EFRt5l7qQ='
WHERE
key_id = '1a38814f4534b49f3dbfffc41327a1bf226eaa3eb27b29009c7b35552ac179da'
AND (
token = 'dvks1Duao7/PTGT2QaeoE0rbumoJtqVtS9EFRt5l7qQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)