UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cClE7mLzJ+U1zKvcyjM3Z+8WyZ4ZMLFWH2mOZmCy/oY='
WHERE
key_id = '41355c4eec00c6e87f31d1f6bfe49b75f6b9c5280cba80c5736133ed43593743'
AND (
token = 'cClE7mLzJ+U1zKvcyjM3Z+8WyZ4ZMLFWH2mOZmCy/oY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)