UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FvET3cxlKUsKF9yC8in6JHF4YeIgR60P5o8DJV0gt9Y='
WHERE
key_id = 'f8bb5f76c186a6fca612189fca2bc505d8d159e244355d1c3b90a6a0531bad6c'
AND (
token = 'FvET3cxlKUsKF9yC8in6JHF4YeIgR60P5o8DJV0gt9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)