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

Query time 0.00043