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

Query time 0.00041