UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VCHSPR3dgjpvc7RnKF2M5h/66VxWUYG+IH4VSp2MTvA=' 
WHERE 
  key_id = '8c6a3c8ef2d6b8bdf874ad24a7731cd2501d3186746afb76a08f06a5cb911264' 
  AND (
    token = 'VCHSPR3dgjpvc7RnKF2M5h/66VxWUYG+IH4VSp2MTvA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044