UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+3i0a35nnJ5guEq/tpuFijKhuGlOm7V69oAP+IV7pSQ=' 
WHERE 
  key_id = '80b2c4604e4878f5adb554db687851c37d714f9c0129938e68c5bc458c0963e5' 
  AND (
    token = '+3i0a35nnJ5guEq/tpuFijKhuGlOm7V69oAP+IV7pSQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048