UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yctn1zBF6ky+yEqRP3djPlrwqrSmVh+gOBRhhRMKl8I='
WHERE
key_id = '2804000af0f451161970f6f81b7dd547f46a2dc70948b0b7aa9f269c32ab6839'
AND (
token = 'yctn1zBF6ky+yEqRP3djPlrwqrSmVh+gOBRhhRMKl8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)