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