UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6PJSNW/BXW4NG61NkABW/PtYPgNykU51zK1SmGFzu64=' 
WHERE 
  key_id = '623a53e8c5741e05dd272a73a0b00456f943cbb6260fae053fc0427618a0abb1' 
  AND (
    token = '6PJSNW/BXW4NG61NkABW/PtYPgNykU51zK1SmGFzu64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055