UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vo/+/7RDITBeMRkplTyvAWqwvl5qe1ZMfqLDmC80v88=' 
WHERE 
  key_id = '654b2271fa7135bcd5308a31e377ee0ff1afbac4af0eb97b5f2ac90b97f27ac7' 
  AND (
    token = 'vo/+/7RDITBeMRkplTyvAWqwvl5qe1ZMfqLDmC80v88=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038