UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2pjlXKVCojXtaDtrcYisFfUS0kW72veOcXctSfmyn6U='
WHERE
key_id = '246c81adfecaedf669e11a6835ce77ce3bd6bd9563330dd03b6a718af376050e'
AND (
token = '2pjlXKVCojXtaDtrcYisFfUS0kW72veOcXctSfmyn6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)