UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MCCnmnrT4hvk8siOm0T2BWCaFHo2P7udN+T06VHVoRo='
WHERE
key_id = '5035068b0020f03aa4c1761b3a913ec59f64b963460fafe27f8fb7508b2ad71a'
AND (
token = 'MCCnmnrT4hvk8siOm0T2BWCaFHo2P7udN+T06VHVoRo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)