UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lxD0t4HVQKUc6ri+ODmDxAIgmuVC85AYkyKm0wwzCNM='
WHERE
key_id = '1473003fa4a6f91c10a2f2cd238797bbf4e3083ef32c093d822741e7d4402992'
AND (
token = 'lxD0t4HVQKUc6ri+ODmDxAIgmuVC85AYkyKm0wwzCNM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)