UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '59sDYToaWJwpw/J6B2kCGgSrXlr5uF88xj14aCiXAvM=' 
WHERE 
  key_id = '59325f0948693f49cb7c092016545ec6b915d9aedb5a9122f10ecae9f53f720c' 
  AND (
    token = '59sDYToaWJwpw/J6B2kCGgSrXlr5uF88xj14aCiXAvM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059