UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BxgSWH7xpYrdhQF4fTduDFOFAWGG+43CgULOUtlVSbI=' 
WHERE 
  key_id = 'bcff466c2506efeb88e9091fcf94f5e1fd4e7309e49f777ce2ba5c1139bfdd94' 
  AND (
    token = 'BxgSWH7xpYrdhQF4fTduDFOFAWGG+43CgULOUtlVSbI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026