UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vGl9qoqJHVdU2XqI+VZGFg6RqA9Cp8NIFI0klHZr+VI='
WHERE
key_id = '1ebde57b10e0cf13e3ef549b947d2cc7ffb5117d172c1f7a5dc9530e777343d4'
AND (
token = 'vGl9qoqJHVdU2XqI+VZGFg6RqA9Cp8NIFI0klHZr+VI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)