UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qWAhO516U0lZPiHT/pjsvWKIG3qAtQ3QTjUtDuL+5fo='
WHERE
key_id = 'b9512c0c265c555a534687158c24322d4b6f7c8971b10c5ed57b35e108e48dfd'
AND (
token = 'qWAhO516U0lZPiHT/pjsvWKIG3qAtQ3QTjUtDuL+5fo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)