UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5rsTcDMYgof2vsmU7ucFYt6WkCB1uQUJmo73aJx+xPA=' 
WHERE 
  key_id = 'c284ddabdeac1b78fdf466ca4b60f5c792e3598ab5730da41bb93f5fb1f05bb7' 
  AND (
    token = '5rsTcDMYgof2vsmU7ucFYt6WkCB1uQUJmo73aJx+xPA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038