UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0E/jyakTnjAoLqKdZb56aZHcPmKn23Q6AsjbFtU5ZjI='
WHERE
key_id = '2771f9c53902a13994e688d24ce439befddb2dea74315e3fd1f0917e4f85f366'
AND (
token = '0E/jyakTnjAoLqKdZb56aZHcPmKn23Q6AsjbFtU5ZjI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)