UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '54L80LwNkSjJjDJmrAOSPeCQnvNF6EdZiXdIqNZKKes='
WHERE
key_id = 'b3961c941481326f850b049f7019292a2f64265b9150dc56ac316e16910a192b'
AND (
token = '54L80LwNkSjJjDJmrAOSPeCQnvNF6EdZiXdIqNZKKes='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)