UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1c7BRhO6m4FDTg0DFpt1X1F0XemUCDUffHblvIJGVKQ=' 
WHERE 
  key_id = '5e20ddf9610d19cd6aa3decd65fc0aae428cdabc35af5a575ac63e98c77f9321' 
  AND (
    token = '1c7BRhO6m4FDTg0DFpt1X1F0XemUCDUffHblvIJGVKQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025