UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I9vJadiv4XtgM0pHrdodPjVG7bR5/I/ghD21FGUvE74=' 
WHERE 
  key_id = '4a5127e89709ac1f2ee90eaea9d2563aa2b982b83e4cbd9738a26bd44c560a5c' 
  AND (
    token = 'I9vJadiv4XtgM0pHrdodPjVG7bR5/I/ghD21FGUvE74=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015