UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1TP6JynmXXBcnclNf0u7fNZ4t46NjDHKbh36UEIQ8X4='
WHERE
key_id = '8357edad11249ea959b51bb2e843f6efb5b3336a0a327d3af15bb88b8c61a2a9'
AND (
token = '1TP6JynmXXBcnclNf0u7fNZ4t46NjDHKbh36UEIQ8X4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)