UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nnUf92F/vFhLQ5NosHhX2czVa2YSHXx9eDkmcyxcnhA='
WHERE
key_id = '03a095bacbe9fb72e5d5a9d87c22251992a5676148ac6a7a97d4d24d76db5e40'
AND (
token = 'nnUf92F/vFhLQ5NosHhX2czVa2YSHXx9eDkmcyxcnhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)