UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hcpK4V4oGMh5UZt4Z2kFkhIeYng6ptat6uEN1T96xbo='
WHERE
key_id = '5de3053522cfd378bf91680fe65d2b0df6f03954adca6b4d223ec62ecdd8f691'
AND (
token = 'hcpK4V4oGMh5UZt4Z2kFkhIeYng6ptat6uEN1T96xbo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)