UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L48ytREVjnMjzUTQpdSq2+qA3orJWqcPisbOf8KS2FA='
WHERE
key_id = 'db090034949e4b48bda4d4182b98e4597def31c5370acc7e8ef34123ba4874b5'
AND (
token = 'L48ytREVjnMjzUTQpdSq2+qA3orJWqcPisbOf8KS2FA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)