UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c/SG+uTc2kukYBkD7B+K4b4qRhCnvzHlyJnQLbd2TeI=' 
WHERE 
  key_id = '3cbc16a6374e86cfb4816afb216e38079a4c65ba8c9c64a3ee08b4426a578326' 
  AND (
    token = 'c/SG+uTc2kukYBkD7B+K4b4qRhCnvzHlyJnQLbd2TeI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028