UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ngyQqUSwmdOjwMObOnUPZUqLZBFvvmkFOg2Wr/LItAI='
WHERE
key_id = '333a5afbbb0713c590b8b55b95a897a42a645c1c2e6bd704006fbb212580cd55'
AND (
token = 'ngyQqUSwmdOjwMObOnUPZUqLZBFvvmkFOg2Wr/LItAI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)