UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iWRzSEYdGfxyqCG8TOwb8VHyHF8TjysxLuks7Q/Sflc='
WHERE
key_id = 'a640f4c637f049a9454d7d72b345c56c2d1a640d7c1efc524b457e0615e3819a'
AND (
token = 'iWRzSEYdGfxyqCG8TOwb8VHyHF8TjysxLuks7Q/Sflc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)