UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nfSTk4r6cLYWS+idhJ1xZyk9EZnmyIfeYUVD4B6/oJs='
WHERE
key_id = '5e132e299168d34f25ba221568251e386bf351484ccee09f1f2bec1f8a42bf86'
AND (
token = 'nfSTk4r6cLYWS+idhJ1xZyk9EZnmyIfeYUVD4B6/oJs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)