UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'olchVMovjl4RlPmtImHzSvjwLAhU2TQb3lhRs86R1Po=' 
WHERE 
  key_id = 'b2eb6cfd0e197a6086495ca80e9fe9227bd9e9ac72df18fe5b0e9bda4fc8f202' 
  AND (
    token = 'olchVMovjl4RlPmtImHzSvjwLAhU2TQb3lhRs86R1Po=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00110