UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iT1qevyH2FYuNNYw/IruFAq7Ur8q044TJbGPIiXc1gY='
WHERE
key_id = 'e8cf5326bf696f779c88afff874b144b33da28e0aebeeae3823fe2693a8274f2'
AND (
token = 'iT1qevyH2FYuNNYw/IruFAq7Ur8q044TJbGPIiXc1gY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)