UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2+VCF6onEjpqooXm13pp9t9GcV/+8ZSGq9ej5vwOzds='
WHERE
key_id = '0f54f3ad1ed3bbd6d38e8ccea9675aa1a2f6dea8137d82e1f21e4d6eed8edc80'
AND (
token = '2+VCF6onEjpqooXm13pp9t9GcV/+8ZSGq9ej5vwOzds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)