UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FD4IRVeHJBKbgBHIRh7mHlaJ5PDcMKGwvQmWhh8ZQbk='
WHERE
key_id = '41942e4cb7e0e897ad90f79082dd36876b7d2028c8b83073781cc46f6f402105'
AND (
token = 'FD4IRVeHJBKbgBHIRh7mHlaJ5PDcMKGwvQmWhh8ZQbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)