UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EqPmCoYI7G1IqJ21gYhwABELim+S1jAEUTNNn7sRw74='
WHERE
key_id = '4000da16dfce6f13bab6938df0874a09341434258be6c2133d1bff70a6b07275'
AND (
token = 'EqPmCoYI7G1IqJ21gYhwABELim+S1jAEUTNNn7sRw74='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)